const express = require('express');
const asyncHandler = require('express-async-handler');
const basicController = require('../controllers/basic.controller')
const router = express.Router();
module.exports = router;

router.post('/getVehicleDataByDuration', asyncHandler(getVehicleDataByDuration))
router.post('/addLprWhiteList', asyncHandler(addLprWhiteList))
router.post('/getLprWhiteList', asyncHandler(getLprWhiteList))
router.post('/removeLprWhiteList', asyncHandler(removeLprWhiteList))
router.post('/updateLprInfosById', asyncHandler(updateLprInfosById))

async function getVehicleDataByDuration(req, res) {
    let result = await basicController.getVehicleDataByDuration(req.body)
    res.json(result)
}

async function addLprWhiteList(req, res) {
    let result = await basicController.addLprWhiteList(req.body)
    res.json(result)
}

async function getLprWhiteList(req, res) {
    let result = await basicController.getLprWhiteList(req.body)
    res.json(result)
}

async function removeLprWhiteList(req, res) {
    let result = await basicController.removeLprWhiteList(req.body)
    res.json(result)
}

async function updateLprInfosById(req, res) {
    let result = await basicController.updateLprInfosById(req.body)
    res.json(result)
}
